Page({
    methods: {
      onTabsChange(event) {
        console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
      },
  
      onTabsClick(event) {
        console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
      },
      toNext() {
        this.setData({ count: this.data.count + 1 });
      },
      onCascader(e) {
        const { current } = e.detail;
    
        this.setData({
          count: current + 1,
        });
      },
      onFirstChange(e) {
        this.setData({ first: e.detail.current });
      },
      onSecondChange(e) {
        this.setData({ second: e.detail.current });
      },
      onThirdChange(e) {
        this.setData({ third: e.detail.current });
      }
    },
    
  

  /**
   * 页面的初始数据
   */
  data: {
    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
    count: 4,
    id:0,
    highlightList:[
      {id:"001",time:"2024-05-21",number:"000001",trendId:"1"},
      {id:"002",time:"2024-05-21",number:"000002",trendId:"2"},
      {id:"004",time:"2024-05-21",number:"000003",trendId:"3"},
      {id:"005",time:"2024-05-21",number:"000004",trendId:"4"},
      {id:"006",time:"2024-05-21",number:"000005",trendId:"5"},
      {id:"007",time:"2024-05-21",number:"000006",trendId:"6"},
      {id:"008",time:"2024-05-21",number:"000007",trendId:"7"}
    ],
    tabs: [  
      { title: '当前受精记录', content: '这是选项卡1的内容'},  
      { title: '历史受精记录', content: '这是选项卡2的内容' }
    ],  
    tabs_current_content:[
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'/images/25.png',djnumber:'12345',sjtime:'2024-05-26'}
    ],
    tabs_history_content:[
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'/images/25.png',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'},
      {number:'1111111',time:'2024-05-21',t:'29天',zhuangtai:'已接单...',beizhu:'无',name:'李四',work:'高级改良员',img:'https://www.keaitupian.cn/cjpic/frombd/1/253/1536986110/177461821.jpg',djnumber:'12345',sjtime:'2024-05-26'}
    ],
    currentTab: 0  ,
    first: 1,
    second: 1,
    third: 1,
    stepitem:[
      {title:'受精成功',content:'2024-05-26'},
      {title:'怀孕中',content:'270-285天'},
      {title:'生产',content:'2025-2-26'},
      {title:'完成',content:'2025-2-26'}

    ],
    page:1,
    limit:10
  },
  //触底加载
  onPullDownRefresh: function() {  
    this.setData({  
      page: 1,  
      list: []  
    });  
    this.loadData(); // 调用加载数据的函数  
    wx.stopPullDownRefresh(); // 请求完成后停止下拉刷新  
  },
  onPullDownRefresh: function() {  
    this.setData({  
      page: 1,  
      list: []  
    });  
    this.loadData(); // 调用加载数据的函数  
    wx.stopPullDownRefresh(); // 请求完成后停止下拉刷新  
  },
  loadData: function() {  
    const that = this;  
    wx.request({  
      url: '你的数据接口', // 替换为你的数据接口地址  
      data: {  
        page: that.data.page,  
        limit: that.data.limit  
      },  
      success: function(res) {  
        // 假设服务器返回的数据在res.data.records中，总条数在res.data.total中  
        that.setData({  
          list: [...that.data.list, ...res.data.records]  
        });  
        // 如果需要，你可以在这里更新总条数等其他信息  
      },  
      fail: function(err) {  
        // 处理请求失败的情况  
        console.error(err);  
      }  
    });  
  },

  
  switchTab(e) {  
    const index = e.currentTarget.dataset.index;  
    this.setData({  
      currentTab: index  
    });  
  },  
  
  swiperChange(e) {  
    this.setData({  
      currentTab: e.detail.current  
    });  
  }  ,

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
     console.log("show",options.id)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})